﻿using CxRomos.Core.Domain.Entities;
using FluentNHibernate.Mapping;

namespace CxRomos.Core.Domain.Mappings {
    public class AccountMap : ClassMap<Account> {
        public AccountMap() {
            Table("[dbo].[Accounts]");
            OptimisticLock.Version();
            LazyLoad();

            Id(x => x.AccountId)
                .Column("AccountId")
                .GeneratedBy.Identity();

            Map(x => x.AgreedToTermsDate);
            Map(x => x.BirthDate);
            Map(x => x.CreateDate);
            Map(x => x.Email);
            Map(x => x.EmailVerified);
            Map(x => x.FirstName);
            Map(x => x.LastName);
            Map(x => x.LastUpdateDate);
            Map(x => x.Password);
            Map(x => x.TermId).Column("TermId");
            Map(x => x.Username);
            Map(x => x.Zip);
        }
    }
}